window.addEventListener('load',function(){
 
 
 // 轮播图
 var test = new Swiper('.swiper-test',{
 	pagination: { // 分页器
 	    el: '.swiper-test .swiper-pagination',
 		clickable: true,
 	},
	// 前进/后退按钮
	navigation: {
		nextEl: '.swiper-test .swiper-button-next',
		prevEl: '.swiper-test .swiper-button-prev',
	},
	
	loop: true, // 循环
	autoplay: true, // 自动切换
	autoplay: {
		delay: 3000,
	},
	speed: 1000, // 切换的时间间隔
	
	on: {
		init: function(swiper){
			// Swiper初始化了
			console.log('当前的slide序号是'+this.activeIndex);
		}, 
		// 切换完毕
		transitionEnd: function(){
			// swiper属性 realIndex当前的活跃项的索引从0开始
			console.log(this.realIndex);
		},
	}
	})
 
 var li = document.querySelectorAll(".list1 li" );
 var contens = document.querySelectorAll(".tab_content div");
 for(var i=0;i<=li.length-1;i++){
	 li[i].setAttribute("index",i);
	 li[i].onclick = function(){
		var index =this.getAttribute("index");
      for(var j =0;j<=li.length-1;j++){
		  li[j].classList.remove("active");
		  contens[j].classList.remove("show");
	  }
	  li[index].classList.add("active");
	  contens[index].classList.add("show");
	 }
 }
   var contens_li =document.querySelectorAll(".tab_content div li");
  for(var i=0;i<=contens_li.length-1;i++){
	  contens_li[i].setAttribute("index",i);
	  	 contens_li[i].onclick = function(){
	  		var index2 =this.getAttribute("index");
	       for(var j =0;j<=contens_li.length-1;j++){
	  		  contens_li[j].classList.remove("active");
	  	  }
	  	  contens_li[index2].classList.add("active");
	  	 }
	  }
	  
	// 全选全不选
	 var  ckall = document.querySelector(".yiwai .ckall");
	 var  item = document.querySelector(".yiwai .item");
     ckall.onclick = function(){
		 item.checked = ckall.checked;
	 }
	 item.onclick = function(){
	 	ckall.checked = item.checked;
	 }
	 var  cka = document.querySelector(".yiwai .cka");
	 var  ite = document.querySelector(".yiwai .ite");
	 cka.onclick = function(){
	 		 ite.checked = cka.checked;
	 }
	 ite.onclick = function(){
	 	cka.checked = ite.checked;
	 }
	 // 选项卡
	 var yiwai_li =document.querySelectorAll(".yiwai ul li");
	 for(var i=0;i<=yiwai_li.length-1;i++){
	 	  yiwai_li[i].setAttribute("index",i);
	 	  	 yiwai_li[i].onclick = function(){
	 	  		var index2 =this.getAttribute("index");
	 	       for(var j =0;j<=yiwai_li.length-1;j++){
	 	  		  yiwai_li[j].classList.remove("active");
	 	  	  }
	 	  	  yiwai_li[index2].classList.add("active");
	 	  	 }
	 	  }
	
	var  c = document.querySelector(".yiwai .c");
	var  i = document.querySelector(".yiwai .i");
	c.onclick = function(){
			 i.checked = c.checked;
	}
	i.onclick = function(){
		c.checked = i.checked;
	}
	var  ck = document.querySelector(".yiwai .ck");
	var  it = document.querySelector(".yiwai .it");
	ck.onclick = function(){
			 it.checked = ck.checked;
	}
	it.onclick = function(){
		ck.checked = it.checked;
	}
	var  ckal = document.querySelector(".yiwai .ckal");
	var  items = document.querySelector(".yiwai .items");
	ckal.onclick = function(){
			 items.checked = ckal.checked;
	}
	items.onclick = function(){
		ckal.checked = items.checked;
	}
	var  ckalll = document.querySelector(".yiwai .ckalll");
	var  itemm = document.querySelector(".yiwai .itemm");
	ckalll.onclick = function(){
			 itemm.checked = ckalll.checked;
	}
	itemm.onclick = function(){
		ckalll.checked = itemm.checked;
	}

})